#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/RenderTargetJack.h"

using namespace fxcc::yml;
using namespace fxcc::graph::common;

using CType = fxcc::graph::common::RenderTargetJack;;

template<>
void Serializer::Encode<CType::Desc>(YAML::Node& node, const CType::Desc& inst)
{
	SetVariable<ImageMipmap::MipMapData>(node,"m_MipmapData", inst.m_MipmapData);
	SetVariable<int>(node, "m_NumTextures", inst.m_NumTextures);
	SetVariableEnum<fxcc::graph::common::AttachmentType>(node, "m_AttachmentType ", inst.m_AttachmentType);

}


template<>
bool Serializer::Decode<CType::Desc>(const YAML::Node& node, CType::Desc& inst)
{
	GetVariable<ImageMipmap::MipMapData>(node, "m_MipmapData", inst.m_MipmapData);
	GetVariable<int>(node, "m_NumTextures", inst.m_NumTextures);
	GetVariableEnum<fxcc::graph::common::AttachmentType>(node, "m_AttachmentType ", inst.m_AttachmentType);

	return true;
}

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{
	SetVariable<CType::Desc>(node, "m_Desc", inst.m_Desc);

}


template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{
	GetVariable<CType::Desc>(node, "m_Desc", inst.m_Desc);
	return true;
}